package com.mike.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mike.model.User;

public class UserService {


    public static boolean addUser(String param) {
        User user = new User();
        JSONObject json = JSON.parseObject(param);
        user.setId(json.getString("id"));
        user.setName(json.getString("name"));
        return true;
    }

    public static boolean deleteUser(String id,String param) {
        return true;
    }

    public static User updateUser(String id,String param) {
        User user = new User();
        JSONObject json = JSON.parseObject(param);
        user.setId(json.getString("id"));
        user.setName(json.getString("name"));
        return user;
    }


    public static User getUser(String id) {
        User user = new User();
        user.setId("123456");
        user.setName("mike");
        return user;
    }
}
